<!-- 排名列表 -->

<template>
  <div class="EnergyOverview-RankList">
    <div>
      <div class="flexCC">
        <span class="flex3">排名</span>
        <span class="flex5">名称</span>
        <span class="flex4">用量</span>
      </div>

      <div v-for="(item, i) in info.dataList.slice(0, 5)" :key="item[0] || i" class="flexCC">
        <div class="flex3 flexCC">
          <i v-if="i === 3" class="PrimaryColor9">{{ item[0] }}</i>
          <i v-else-if="i === 4" class="PrimaryColor8">{{ item[0] }}</i>
          <span v-else>
            <img v-for="num in 3 - i" :key="num" :src="CORE.common('energy/icon-elec.png')" />
          </span>
        </div>
        <div class="flex5 flexCC">
          <span class="ellips">{{ item[1] }}</span>
        </div>
        <div class="flex4 flexCC">
          <span>{{ item[2] }}</span>
        </div>
      </div>
    </div>

    <div>
      <div class="flexCC">
        <span class="flex3">排名</span>
        <span class="flex5">名称</span>
        <span class="flex4">用量</span>
      </div>

      <div v-for="(item, i) in info.dataList.slice(5, 10)" :key="item[0] || i" class="flexCC">
        <div class="flex3 flexCC">
          <i :class="`PrimaryColor${7 - i}`">{{ item[0] }}</i>
        </div>
        <div class="flex5 flexCC">
          <span class="ellips">{{ item[1] }}</span>
        </div>
        <div class="flex4 flexCC">
          <span>{{ item[2] }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'RankList',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixInfo()],
}
</script>
